<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>JavaScript Date对象的简单应用</title>
    </head>
    <body>
        <h3>JavaScript Date对象的简单应用</h3>
        <hr />
        <script>
		//获取当前日期时间对象
		var date = new Date();
		//获取年份
		var year = date.getFullYear();
		//获取月份
		var month = date.getMonth()+1;
		//获取天数
		var day = date.getDate();
		//获取星期
		var week = date.getDay();
		alert("当前是"+year+"年"+""+month+"月"+day+"日，星期"+week);
        </script>
    </body>
</html>